<?php slot('contents') ?>


	<script type="text/javascript" src="/web/js/swfupload.js"></script>
	<script type="text/javascript" src="/web/js/swfupload.queue.js"></script>
	<script type="text/javascript" src="/web/js/fileprogress.js"></script>
	<script type="text/javascript" src="/web/js/handlers.js"></script>
	<script type="text/javascript">
		var swfu;

		window.onload = function() {
			var settings = {
				flash_url : "/web/js/swfupload.swf",
				upload_url: "/upload.php",
				post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},
				file_size_limit : "10 MB",
				file_types : "*.*",
				file_types_description : "All Files",
				file_upload_limit : 5,
				file_queue_limit : 0,
				custom_settings : {
					progressTarget : "fsUploadProgress",
					cancelButtonId : "btnCancel"
				},
				debug: false,

				// Button settings
				button_image_url: "",
				button_width: "217",
				button_height: "21",
				button_placeholder_id: "browse",
				button_text_left_padding: 0,
				button_text_top_padding: 3,
				button_window_mode : SWFUpload.WINDOW_MODE.TRANSPARENT,

				// The event handler functions are defined in handlers.js
				file_queued_handler : fileQueued,
				file_queue_error_handler : fileQueueError,
				file_dialog_complete_handler : fileDialogComplete,
				upload_start_handler : uploadStart,
				upload_progress_handler : uploadProgress,
				upload_error_handler : uploadError,
				upload_success_handler : uploadSuccess,
				upload_complete_handler : uploadComplete,
				queue_complete_handler : queueComplete	// Queue plugin event
			};

			swfu = new SWFUpload(settings);
	     };
	</script>
         <div class="block01 contact-form content">
           <?php if($form->hasErrors()) : ?>
             <h1><?php echo implode('<br>', $errors) ?></h1>
           <?php else: ?>
             <?php if($sf_user->hasFlash('success')): ?>
              <h1>Teie pakkumine saadetud</h1>
             <?php else: ?>
              <h1>Küsi pakkumist:</h1>
             <?php endif; ?>
           <?php endif; ?>
			
			<form id="form1" action="" method="post">
			<table>
				<tr>
					<th><?php echo __('Kontaktisik') ?>:</th>
					<td><?php echo $form['name']->render(array('class' => 'default')) ?></td>
				</tr>
				<tr>
					<th><?php echo __('Ettevõte') ?>:</th>
					<td><?php echo $form['company']->render(array('class' => 'default')) ?></td>
				</tr>
				<tr>
					<th><?php echo __('Telefon') ?>:</th>
					<td><?php echo $form['phone']->render(array('class' => 'default')) ?></td>
				</tr>
				<tr>
					<th><?php echo __('E-mail') ?>:</th>
					<td><?php echo $form['email']->render(array('class' => 'default')) ?></td>
				</tr>
				<tr>
					<th><?php echo __('Teade') ?>:</th>
					<td><?php echo $form['message']->render(array('class' => 'default')) ?></td>
				</tr>
				<tr>
					<th colspan="2" class="additional"><?php echo __('Siit on võimalik saata meile ka projekti täpsustavaid materjale. <br />Lisada on võimalik maksimaalselt 5 faili, üldmahuga kuni 10MB.') ?></th>
				</tr>
				<tr>
					<th><?php echo __('Lisa failid') ?>:</th>
					<td>
						<div class="uploader">
							<div>
								<div class="browse_bg">
									<span id="browse"></span>
								</div>
							</div>
							<div class="fieldset flash" id="fsUploadProgress">
							<span class="legend"><?php echo __('Lisatud failid') ?>:</span>
							</div>
							<div style="display: none;">
								<div id="divStatus" style="display: none;">0 Files Uploaded</div>
								<input id="btnCancel" type="button" value="Cancel All Uploads" onclick="swfu.cancelQueue();" disabled="disabled" style="margin-left: 2px; font-size: 8pt; height: 29px;" />
							</div>
						</div>
					</td>
				</tr>
				<tr>
					<th>Sisesta:</th>
					<td class="captcha">
						<img id="captcha_image" src="<?php echo url_for('sf_captchagd', array('r' => time() ) ) ?>" width="77" height="20" alt=""/>
						<?php echo $form['captcha']->render(array('class' => 'min')) ?>
                        <div style="display:none">
                             <input type="hidden" name="<?php echo $form->getCSRFFieldName() ?>" value="<?php echo $form->getCSRFToken() ?>" />
                        </div>
						<input type="image" src="/web/img/bg10.png" />
					</td>
				</tr>

			</table>
			</form>
		</div>
<?php end_slot(); ?>
